Date.prototype.format = function (format) {
  var o = {
    "M+": this.getMonth() + 1, //month
    "d+": this.getDate(), //day
    "H+": this.getHours(), //hour
    "m+": this.getMinutes(), //minute
    "s+": this.getSeconds(), //second
    "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
    "S": this.getMilliseconds() //millisecond
  }
  let my = new RegExp('(y+)').exec(format);
  if (!!my && my.length > 1)
    format = format.replace(my[1], (this.getFullYear() + "").substring(4 - my[1].length));
  for (var k in o) {
    let mo = new RegExp("(" + k + ")").exec(format);
    if (!!mo && mo.length > 1) {
      format = format.replace(mo[1], mo[1].length == 1 ? o[k] : ("00" + o[k]).substring(("" + o[k]).length));
    }
  }
  return format;
}

Date.prototype.isCurrentMonth = function () {
  const now = new Date();
  const targetMonth = this.getMonth();
  const targetYear = this.getFullYear();
  const currentMonth = now.getMonth();
  const currentYear = now.getFullYear();
  return targetMonth === currentMonth && targetYear === currentYear;
};